{extend name="pub/base" /}
{block name="title"}
<title>财务查询</title>
{/block}

{block name="body"}
<section class="Hui-admin-article">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px"><i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        财务查询
        <span class="c-gray en">&gt;</span>
        财务列表
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
           href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
    </nav>
    <article class="Hui-admin-content clearfix">
        <div class="panel">
            <div class="panel-body">
                <div class="text-c">
                    <input type="text" placeholder="用户id" style="width:250px" id="uid" class="input-text">
                    <span class="select-box" style="width:150px;">
                            <select id="usage" class="select" name="usage" size="1">
                                <option value="0" selected="selected">全部</option>
                                <option value="1">用户充值</option>
                                <option value="2">购买vip</option>
                                <option value="3">购买章节</option>
                                <option value="4">推广奖励</option>
                                <option value="5">绑定手机奖励</option>
                            </select>
                     </span>
                    <button type="submit" class="btn btn-success" onclick="search()"><i
                            class="Hui-iconfont">&#xe665;</i> 查询
                    </button>
                </div>
                <script>
                    function search() {
                        var uid = $('#uid').val();
                        var usage = $('#usage option:selected').val();
                        location.href = "finance?usage=" + usage + "&uid=" + uid;
                    }
                </script>
            </div>
        </div>
        <div class="panel mt-20">
            <div class="panel-body">
                <div class="clearfix">
                    <span class="f-r">共有数据：<strong>{$count}</strong> 条</span>
                </div>
                <div class="mt-20 clearfix">
                    <table class="table table-border table-bordered table-bg table-hover table-sort">
                        <thead>
                        <tr class="text-c">
                            <th width="80">ID</th>
                            <th width="80">用户ID</th>
                            <th width="100">金额</th>
                            <th width="100">用途</th>
                            <th width="120">备注</th>
                            <th width="120">发生时间</th>
                            <th width="200">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="finances" id="vo"}
                        <tr class="text-c">
                            <td>{$vo.id}</td>
                            <td>{$vo.user_id}</td>
                            <td>{$vo.money}</td>
                            <td>
                                {if $vo.usage ==1 }
                                用户充值
                                {elseif $vo.usage ==2}
                                购买vip
                                {elseif $vo.usage ==3}
                                购买章节
                                {elseif $vo.usage ==4}
                                推广奖励
                                {/if}
                            </td>
                            <td>{$vo.summary}</td>
                            <td>{$vo.create_time|date='Y-m-d H:i'}</td>
                            <td class="f-14 td-manage">
                                <a style="text-decoration:none" class="ml-5" onclick="del(this,{$vo.id})"
                                   href="javascript:;"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                    {$finances|raw}
                </div>
            </div>
        </div>
    </article>

</section>
{/block}